package com.hspedu.homework.homework05;

/**
 * @Author Stringzhua
 * @Date 2024/3/3 17:44
 * description:科学家类
 */
public class Scientist extends Employee {//子类
    //私有属性:年终奖 bonus
    private double bonus;
    //方法
//重写年工资打印方法printSal

    @Override
    public void printSal() {
        System.out.println("科学家  " + getName() + "  年工资是:" + (getSal() * getSalMonth() + bonus));
    }

    //构造器

    public Scientist(String name, double sal) {
        super(name, sal);
    }
    //getset方法

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }
}
